<?php
defined('IN_TS') or die('Access Denied.');
require_once 'config.php';
$userid = intval($TS_USER['user']['userid']);

//用户信息
if ($userid =='12'){
$talkid ='2';
}else{
$talkid = '1';
}
$imgUrl = $_GET['imgUrl'];

$purl = $_GET['pageUrl'];

ereg("id=([0-9])+",$purl,$regs);
$id_iid = $regs[0];
$url_iid = str_replace('id=','',$id_iid);
$purlg = "http://item.taobao.com/item.htm?id=".$url_iid;
	$num_iid = $url_iid;
				$paramArr = array(
			
					/* API系统级输入参数 Start */
			
						'method' => 'taobao.taobaoke.items.detail.get',   //API名称
					 'timestamp' => date('Y-m-d H:i:s'),			
						'format' => 'xml',  //返回格式,本demo仅支持xml
					   'app_key' => $appKey,  //Appkey			
							 'v' => '2.0',   //API版本号		   
					'sign_method'=> 'md5', //签名方式			
			
					/* API系统级参数 End */			
			
					/* API应用级输入参数 Start*/
			
						'fields' => 'iid,detail_url,num_iid,title,nick,type,cid,seller_cids,props,input_pids,input_str,desc,pic_url,num,valid_thru,list_time,delist_time,stuff_status,location,price,post_fee,express_fee,ems_fee,has_discount,freight_payer,has_invoice,has_warranty,has_showcase,modified,increment,auto_repost,approve,status,postage_id,product_id,auction_point,property_alias,item_imgs,prop_imgs,skus,outer_id,is_virtual,is_taobao,is_ex,videos,is_3D,score,volume,one_station,click_url,shop_click_url,seller_credit_score,approve_status', //返回字段
					  'num_iids' => $num_iid, //Num_iid
						  'nick' => $userNick, //推广者昵称
				
					/* API应用级输入参数 End*/	
				);
			
				//生成签名
				$sign = createSign($paramArr,$appSecret);
				
				//组织参数
				$strParam = createStrParam($paramArr);
				$strParam .= 'sign='.$sign;
				
				//构造Url
				$urls = $url.$strParam;
				
				//连接超时自动重试
				$cnt=0;	
				while($cnt < 3 && ($result=@vita_get_url_content($urls))===FALSE) $cnt++;
				
				//解析Xml数据
				$result = getXmlData($result);
				
				//获取错误信息
				$sub_msg = $result['sub_msg'];
				
				//返回结果
				$taobaokeItemdetail = $result['taobaoke_item_details']['taobaoke_item_detail']['item'];
				$taobaokeItem = $result['taobaoke_item_details']['taobaoke_item_detail'];
			$price = $taobaokeItemdetail['price'];
$titlee = $_GET['title'];

include_once 'keywordsdata.php';

foreach ($keywordarr as $key) {
	if (strstr($titlee,$key)){
	$tagstr .=$key.',';
	}
}

$tgga = $tagstr;

if($userid == '0'){
	include template("sl");
	return false; //未登陆不能发宝贝^_^
}

//包含模版
include template("Post_topic");